package com.iwomy.secureplat.platform.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 告警规则
 *
 * @author pig
 * @date 2023-12-22 10:09:21
 */
@Data
@TableName("alarm_rules")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "告警规则")
public class AlarmRulesEntity extends Model<AlarmRulesEntity> {


	/**
	 * ID
	 */
	@TableId(type = IdType.ASSIGN_ID)
	@Schema(description = "ID")
	private Long id;

	/**
	 * 备注
	 */
	@Schema(description = "备注")
	private String remarks;
	/**
	 * 规则名称
	 */
	@Schema(description = "规则名称")
	private String ruleName;

	/**
	 * 排序
	 */
	@Schema(description = "排序")
	private Integer sort;

	/**
	 * 状态 10禁用  20 启用
	 */
	@Schema(description = "状态 10禁用  20 启用")
	private Integer state;

	/**
	 * 单位id
	 */
	@Schema(description = "单位id")
	private Long deptId;

	/**
	 * 事件ID
	 */
	@Schema(description = "事件ID")
	private Long eventTypeId;

	/**
	 * 事件类型ID
	 */
	@Schema(description = "事件类型ID")
	private String eventTypeCode;

	/**
	 * 事件类型名称
	 */
	@Schema(description = "事件类型名称")
	@TableField(condition = SqlCondition.LIKE)
	private String eventTypeName;

	/**
	 * 设备类型ID
	 */
	@Schema(description = "设备类型ID")
	private Long deviceTypeId;

	/**
	 * 设备类型名称
	 */
	@Schema(description = "设备类型名称")
	@TableField(condition = SqlCondition.LIKE)
	private String deviceTypeName;

	/**
	 * 设备型号ID
	 */
	@Schema(description = "设备型号ID")
	private Long deviceModelId;

	/**
	 * 设备型号名称
	 */
	@Schema(description = "设备型号名称")
	@TableField(condition = SqlCondition.LIKE)
	private String deviceModelName;

	/**
	 * 检测类型ID
	 */
	@Schema(description = "检测类型ID")
	private Long detectionId;

	/**
	 * 检测类型code
	 */
	@Schema(description = "检测类型code")
	@TableField(condition = SqlCondition.LIKE)
	private String detectionTypeCode;

	/**
	 * 检测类型名称
	 */
	@Schema(description = "检测类型名称")
	@TableField(condition = SqlCondition.LIKE)
	private String detectionTypeName;

	/**
	 * 表达式
	 */
	@Schema(description = "表达式")
	private String expression;

	/**
	 * 用于计算的表达式
	 */
	@Schema(description = "用于计算的表达式")
	private String calcExpression;

	/**
	 * 短信报警 10禁用 20 启用
	 */
	@Schema(description = "短信报警 10禁用 20 启用")
	private Integer smsAlarm;

	/**
	 * 公众号报警 10禁用 20 启用
	 */
	@Schema(description = "公众号报警 10禁用 20 启用")
	private Integer officialAccountAlarm;

	/**
	 * 电话报警 10禁用 20 启用
	 */
	@Schema(description = "电话报警 10禁用 20 启用")
	private Integer telephoneAlarm;

	/**
	 * 创建人
	 */
	@TableField(fill = FieldFill.INSERT)
	@Schema(description = "创建人")
	private String createBy;

	/**
	 * 创建时间
	 */
	@TableField(fill = FieldFill.INSERT)
	@Schema(description = "创建时间")
	private LocalDateTime createTime;

	/**
	 * 修改人
	 */
	@TableField(fill = FieldFill.INSERT_UPDATE)
	@Schema(description = "修改人")
	private String updateBy;

	/**
	 * 修改时间
	 */
	@TableField(fill = FieldFill.INSERT_UPDATE)
	@Schema(description = "修改时间")
	private LocalDateTime updateTime;

	/**
	 * 是否被删除标记（0未删除；1已删除）
	 */
	@TableLogic
	@TableField(fill = FieldFill.INSERT)
	@Schema(description = "是否被删除标记（0未删除；1已删除）")
	private String delFlag;

	/**
	 * 租户ID
	 */
	@Schema(description = "租户ID")
	private Long tenantId;

	/**
	 * 传感器ID
	 */
	@Schema(description = "传感器ID")
	private Long sensorId;

	/**
	 * 传感器类型ID
	 */
	@Schema(description = "传感器类型ID")
	@TableField(condition = SqlCondition.LIKE)
	private String sensorTypeCode;

	/**
	 * 传感器类型名称
	 */
	@Schema(description = "传感器类型名称")
	@TableField(condition = SqlCondition.LIKE)
	private String sensorTypeName;

	/**
	 * 报警类型ID
	 */
	@Schema(description = "报警类型ID")
	private Long alarmTypeId;

	/**
	 * 报警类型名称
	 */
	@Schema(description = "报警类型名称")
	@TableField(condition = SqlCondition.LIKE)
	private String alarmTypeName;
	/**
	 * 报警类型code
	 */
	@Schema(description = "报警类型名称")
	@TableField(condition = SqlCondition.LIKE)
	private String alarmTypeCode;

}